package ar.com.candoit.utils;

import java.beans.PropertyEditorSupport;

import ar.com.candoit.beans.Student;
import ar.com.candoit.service.StudentServiceImpl;

public class StudentEditor extends PropertyEditorSupport {

	private final StudentServiceImpl studentService;

	public StudentEditor(StudentServiceImpl ss) {
		this.studentService = ss;
	}

	@Override
	public void setAsText(String text) {
		Student s = studentService.finByDesc(text);
		setValue(s);
	}
}
